home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Tools / Languages / Caml Light 0.61 / Source / src / lib / iparsing.mli < prev    next >
Encoding:
Text File  |  1993-09-24  |  1.2 KB  |  41 lines  |  [TEXT/MPS ]

  1. (* Internal interface to the parsing engine *)
  2.  
  3. #open "obj";;
  4. #open "parsing";;
  5.  
  6. type parser_env =
  7.   { mutable s_stack : int vect;         (* States *)
  8.     mutable v_stack : obj vect;         (* Semantic attributes *)
  9.     mutable symb_start_stack : int vect;(* Start positions *)
  10.     mutable symb_end_stack : int vect;  (* End positions *)
  11.     mutable stacksize : int;            (* Size of the stacks *)
  12.     mutable curr_char : int;            (* Last token read *)
  13.     mutable lval : obj;                 (* Its semantic attribute *)
  14.     mutable symb_start : int;           (* Start pos. of the current symbol*)
  15.     mutable symb_end : int;             (* End pos. of the current symbol *)
  16.     mutable sp : int;                   (* The stack pointer *)
  17.     mutable rule_len : int;             (* Number of rsh items in the rule *)
  18.     mutable rule_number : int }         (* Rule number to reduce by *)
  19. ;;
  20.  
  21. type parser_input =
  22.     Start
  23.   | Token_read
  24.   | Stacks_grown_1
  25.   | Stacks_grown_2
  26.   | Semantic_action_computed
  27.  
  28. and parser_output =
  29.     Read_token
  30.   | Raise_parse_error
  31.   | Grow_stacks_1
  32.   | Grow_stacks_2
  33.   | Compute_semantic_action
  34. ;;
  35.  
  36. value parse_engine :
  37.     parse_tables -> parser_env -> parser_input -> obj -> parser_output
  38.     = 4 "parse_engine"
  39. ;;
  40.  
  41.